home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_HDF.idb / usr / freeware / include / hdf / hcomp.h.z / hcomp.h
Encoding:
C/C++ Source or Header  |  1999-01-26  |  5.0 KB  |  128 lines

  1. /****************************************************************************
  2.  * NCSA HDF                                                                 *
  3.  * Software Development Group                                               *
  4.  * National Center for Supercomputing Applications                          *
  5.  * University of Illinois at Urbana-Champaign                               *
  6.  * 605 E. Springfield, Champaign IL 61820                                   *
  7.  *                                                                          *
  8.  * For conditions of distribution and use, see the accompanying             *
  9.  * hdf/COPYING file.                                                        *
  10.  *                                                                          *
  11.  ****************************************************************************/
  12.  
  13. /* $Id: hcomp.h,v 1.18 1996/03/28 21:57:18 koziol Exp $ */
  14.  
  15. /*-----------------------------------------------------------------------------
  16.  * File:    hcomp.h
  17.  * Purpose: header file for compression information & structures
  18.  * Dependencies: should be included after hdf.h
  19.  * Invokes:
  20.  * Contents:
  21.  * Structure definitions: comp_info
  22.  * Constant definitions: lots...
  23.  *---------------------------------------------------------------------------*/
  24.  
  25. /* avoid re-inclusion */
  26. #ifndef __HCOMP_H
  27. #define __HCOMP_H
  28.  
  29. /* For determining which type of modeling is being done */
  30. typedef enum
  31.   {
  32.       COMP_MODEL_STDIO = 0      /* for Standard C I/O model */
  33.   }
  34. comp_model_t;
  35.  
  36. /* For determining which type of encoding is being done */
  37. typedef enum
  38.   {
  39.       COMP_CODE_NONE = 0,       /* don't encode at all, just store */
  40.       COMP_CODE_RLE,            /* for simple RLE encoding */
  41.       COMP_CODE_NBIT,           /* for N-bit encoding */
  42.       COMP_CODE_SKPHUFF,        /* for Skipping huffman encoding */
  43.       COMP_CODE_DEFLATE,        /* for gzip 'deflate' encoding */
  44.       COMP_CODE_INVALID         /* invalid last code, for range checking */
  45.   }
  46. comp_coder_t;
  47.  
  48. /* Compression types available */
  49. #define COMP_NONE       0
  50. #define COMP_JPEG       2
  51. #define COMP_RLE        11
  52. #define COMP_IMCOMP     12
  53.  
  54. #ifndef COMPRESS_MASTER
  55. extern uint16 compress_map[];
  56. #else
  57. uint16      compress_map[COMP_MAX_COMP + 1] =
  58. {                               /* Mapping from compression types to tags */
  59.     0,                          /* No corresponding tag for un-compressed data */
  60.     0,                          /* (1) */
  61.     DFTAG_JPEG5,                /* COMP_JPEG -> DFTAG_JPEG5 (for JPEG compression) */
  62.     0,                          /* (3) */
  63.     0,                          /* (4) */
  64.     0,                          /* (5) */
  65.     0,                          /* (6) */
  66.     0,                          /* (7) */
  67.     0,                          /* (8) */
  68.     0,                          /* (9) */
  69.     0,                          /* (10) */
  70.     DFTAG_RLE,                  /* COMP_RLE -> DFTAG_RLE (for Run-length compression) */
  71.     DFTAG_IMC                   /* COMP_IMCOMP -> DFTAG_IMC (for IMCOMP compression) */
  72. };
  73. #endif
  74.  
  75. typedef union tag_model_info
  76.   {                             /* Union to contain modeling information */
  77.       struct
  78.         {
  79.             int32       nt;     /* number type */
  80.             intn        ndim;   /* number of dimensions */
  81.             int32      *dims;   /* array of dimensions */
  82.         }
  83.       dim;
  84.   }
  85. model_info;
  86.  
  87. typedef union tag_comp_info
  88.   {                             /* Union to contain compression information */
  89.       struct
  90.         {   /* Struct to contain information about how to compress */
  91.             /* or decompress a JPEG encoded 24-bit image */
  92.             intn    quality;    /* Quality factor for JPEG compression, should be from */
  93.             /* 0 (terrible) to 100 (very good) */
  94.             intn    force_baseline;     /* If force_baseline is set to TRUE then */
  95.             /* quantization tables are limited to */
  96.             /* 0..255 for JPEG baseline compability */
  97.             /* This is only an issue for quality */
  98.             /* settings below 24 */
  99.         }
  100.       jpeg;
  101.       struct
  102.         {   /* struct to contain information about how to compress */
  103.             /* or decompress a N-bit encoded dataset */
  104.             int32   nt;     /* number type of the data to encode */
  105.             intn    sign_ext;   /* whether to sign extend or not */
  106.             intn    fill_one;   /* whether to fill with 1's or 0's */
  107.             intn    start_bit;  /* offset of the start bit in the data */
  108.             intn    bit_len;    /* number of bits to store */
  109.         }
  110.       nbit;
  111.       struct
  112.         {   /* struct to contain info about how to compress */
  113.             /* or decompress a "skipping" huffman encoded dataset */
  114.             intn    skp_size;   /* size of the individual elements when skipping */
  115.         }
  116.       skphuff;
  117.       struct
  118.         {   /* struct to contain info about how to compress */
  119.             /* or decompress a gzip encoded dataset */
  120.             intn    level;   /* how hard to work when compressing the data */
  121.         }
  122.       deflate;
  123.   }
  124. comp_info;
  125.  
  126. #endif /* __HCOMP_H */
  127.  
  128.